using System.Collections.Generic;
using System.Windows.Forms;

namespace CRM.WinForms.Common
{
    public static class DataBindExtension
    {
        /// <summary>
        /// Extension Method for binding datagrid as well as List Controls
        /// </summary>
        public static void BindToGrid<T>(this DataGridView dataGridView, IList<T> list)
        {
            dataGridView.DataSource = list;
        }

        public static void BindToList<T>(this ListControl listControl, IList<T> list)
        {
            listControl.DataSource = list;
        }
    }
}